import request from '@/utils/axios'

// 登录
export function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data: data
  })
}

// 获取试卷列表
export function getExamList() {
  return request({
    url: '/exam/list',
    method: 'get'
  })
}

// 获取考试须知
export function getNotice(data) {
  return request({
    url: '/exam/notice',
    method: 'get',
    params: data
  })
}

// 提交每一题
export function submitAnswer(data) {
  return request({
    url: '/exam/answer',
    method: 'post',
    data: data
  })
}

// 提交所有试题
export function submitAllAnswer(data) {
  return request({
    url: '/exam/finish',
    method: 'post',
    data: data
  })
}

// 开始考试
export function startExam(data) {
  return request({
    url: '/exam/startExam',
    method: 'post',
    data: data
  })
}

// 获取当前考试
export function getCurrentExam(data) {
  return request({
    url: '/exam/currentExam',
    method: 'post',
    data
  })
}

// 获取当前考卷
export function getCurrentExamData(path) {
  return request({
    url: path,
    method: 'get',
  })
}

// 获取考试时间
export function getExamTime(data) {
  return request({
    url: '/exam/getTime',
    method: 'get',
    params: data
  })
}

// 获取考试题目
export function getQuestion(data) {
  return request({
    url: '/exam/getPaper',
    method: 'post',
    data: data
  })
  
}
